import pandas as pd


def baseExcel(sExcelFile):
    dict = {}
    df = pd.read_excel(sExcelFile, sheet_name='Sheet1', header=None)

    # 获取最大行和最大列数
    nrows = df.shape[0]
    # ncols = df.columns.size

    # 遍历逐行逐列
    for iRow in range(1, nrows):
        dict.setdefault(df.iloc[iRow, 0], {'NET_CODE': df.iloc[iRow, 1], 'STA_CODE': df.iloc[iRow, 2],
                                           'STA_JIN': df.iloc[iRow, 3], 'STA_WEI': df.iloc[iRow, 4],
                                           'STA_H': df.iloc[iRow, 5]})
    # print(dict)
    return dict


def readExcelDf():
    a = pd.read_excel(r'D:\LK\TMV煤矿项目\应力数据分析\TD\钻孔应力传感器-10-_20240125143622.xlsx')
    print(a)


if __name__ == '__main__':
    readExcelDf()
